<?php
if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );

/**
*
* @package  RealEstateManager
* @copyright 2011 Andrey Kvasnevskiy-OrdaSoft(akbet@mail.ru); Rob de Cleen(rob@decleen.com); 
* Homepage: http://www.ordasoft.com
* @version: 2.1 free $
*
**/



global $mosConfig_absolute_path;
include_once( dirname(__FILE__).'/compat.joomla1.5.php' );
require_once ($mosConfig_absolute_path."/administrator/components/com_realestatemanager/admin.realestatemanager.class.conf.php");
$db = $GLOBALS['database'];
if($realestatemanager_configuration['update']==1){
  echo "Database saved<br/>";
}
else{
  echo 'no update<br/>';
  $query="DROP TABLES IF EXISTS `#__rem_houses`, `#__rem_rent`,
                `#__rem_rent_request`,`#__rem_review`,
                `#__rem_suggestion`,`#__rem_photos`,
                `#__rem_buying_request`, `#__rem_categories`, `#__rem_main_categories`,`#__rem_version`";
  $db->setQuery($query);
  $db->query();
  $query="DELETE FROM `#__categories` WHERE `section` LIKE 'com_realestatemanager'";
  $db->setQuery($query);
  $db->query();
 
}
function com_uninstall()
{
echo "Uninstalled! ";
}


